﻿Ext.define('GS.model.post.Post', {
    extend: 'Ext.data.Model',
    config: {
        fields: [{
            name: 'id',
            type: 'int'
        }, {
            name: 'user_id',
            type: 'int'
        }, {
            name: 'category_id',
            type: 'int'
        }, {
            name: 'title',
            type: 'string',
        }, {
            name: 'body',
            type: 'string',
        }, {
            name: 'date_created',
            type: 'date',
            dateFormat: 'c'
        }, {
            name: 'date_created',
            type: 'date',
            dateFormat: 'c',
        }],

        validations: [
            {type: 'presence', name: 'title', message:"Udfyld title"},
            {type: 'presence', name: 'body', message:"Udfyld oplæg"}
        ]
    }
});